<template>
  <div>
    <p>
      <router-link to="/">回到首页</router-link>
      您访问的页面不存在! 将在 {{ countDown }} 秒后跳转至首页
    </p>
    <img src="../assets/404.jpg" alt="" />
  </div>
</template>

<script>
export default {
  name: 'Notfound',

  data () {
    return {
      countDown: 3
    }
  },

  created () {
    const timerId = setInterval(() => {
      if (this.countDown === 0) {
        this.$router.push('/')
        clearInterval(timerId)
        return
      }
      this.countDown--
    }, 1000)
  }
}
</script>

<style lang="scss" scoped></style>
